package com.heima.wemedia.controller.v1;

import com.heima.apis.wemedia.WmNewsStatisticsControllerApi;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.media.dtos.WmNewsStatisticsDto;
import com.heima.wemedia.service.WmNewsStatisticsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v1/statistics")
public class WmNewsStatisticsController implements WmNewsStatisticsControllerApi {

    @Resource
    private WmNewsStatisticsService wmNewsStatisticsService;

    /**
     * 获取统计数据
     */
    @Override
    @PostMapping("/news")
    public ResponseResult querySratistics(@RequestBody WmNewsStatisticsDto dto) {
        return wmNewsStatisticsService.querySratistics(dto);
    }
}